package com.shensi.appCollect.dao;


import com.shensi.appCollect.pojo.ReductionActivitiesAmountVO;
import com.shensi.appCollect.pojo.ReductionActivitiesVO;
import com.shensi.appCollect.pojo.ReductionActivity;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 立减活动Mapper接口
 * 
 * @author qujia
 * @date 2021-11-03
 */
public interface ReductionActivityMapper 
{
    /**
     * 查询立减活动
     * 
     * @param activityId 立减活动ID
     * @return 立减活动
     */
    public ReductionActivity selectReductionActivityById(Long activityId);

    /**
     * 查询立减活动列表
     * 
     * @param reductionActivity 立减活动
     * @return 立减活动集合
     */
    public List<ReductionActivity> selectReductionActivityList(ReductionActivity reductionActivity);

    /**
     * 新增立减活动
     * 
     * @param reductionActivity 立减活动
     * @return 结果
     */
    public int insertReductionActivity(ReductionActivity reductionActivity);

    /**
     * 修改立减活动
     * 
     * @param reductionActivity 立减活动
     * @return 结果
     */
    public int updateReductionActivity(ReductionActivity reductionActivity);

    /**
     * 删除立减活动
     * 
     * @param activityId 立减活动ID
     * @return 结果
     */
    public int deleteReductionActivityById(Long activityId);

    /**
     * 批量删除立减活动
     * 
     * @param activityIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteReductionActivityByIds(Long[] activityIds);

    public List<ReductionActivity> selectByOrderInfo(Map<String, Object> params);

    List<ReductionActivity> selectByOrderInfoOld(Map<String, Object> params);

    public Map<String,Object> selectActivityCount(Map<String, Object> params);
    
    /**
     * 查询立减活（pos机使用）
     * @param vo
     * @return
     */
    public List<ReductionActivitiesAmountVO> selectReductionActivityStationId(ReductionActivitiesVO vo);
    
    /**
     * 只更新随机立减活动的预算，原因是别的活动方式没有预算
     * @param budget
     * @param activityId
     * @return
     */
    public int updateReductionActivityBudget(@Param("budget")BigDecimal budget,@Param("activityId")Integer activityId);

    List<ReductionActivity> selectReductionActivityByIds(String activityIds);
}
